
#pragma once 

#include <string>

namespace sock {

	class InetAddr {
	public:
		InetAddr( const std::string & host, const std::string & service ): _host( host ), _service( service ){}
		InetAddr( const std::string service ): _service( service ){}
		InetAddr( const std::string & host, unsigned short port ): _host(host) 
		{ 
			char buf[20]; 
			_itoa_s( port, buf, 20, 10 );
			_service.assign( buf ); 
		}
		InetAddr( unsigned short port ) 
		{ 
			char buf[20]; 
			_itoa_s( port, buf, 20, 10 );
			_service.assign( buf );
		}
		const std::string & host() const { return _host; }
		const std::string & service() const { return _service; }
	private:
		std::string _host;
		std::string _service;
	};

}